#define bit(i) (1 << i)

inline unsigned short int bitClear(unsigned short int bit, unsigned short int data)
{
	#ifndef NO_RANGE_CHECKING
		if (bit > 15)
		{
			return (NULL);
		}
	#endif
	
	/* Range did not exceed 15 */
	
	auto unsigned short int result = data & ~(1 << bit);
	
	return (result);
}
	
inline unsigned short int bitSet(unsigned short int bit, unsigned short int data)
{
	#ifndef NO_RANGE_CHECKING
		if (bit > 15)
		{
			return (NULL);
		}
	#endif
	
	auto unsigned short int result = data | (1 << bit);
	
	return (result);
}

inline void bic(unsigned short int bit, unsigned short int* data)
{
	#ifndef NO_RANGE_CHECKING
		if (bit <= 15)
		{
			*data &= ~(1 << bit);
		}
		
	#else
		*data &= ~(1 << bit);
	#endif
}

inline void bis(unsigned short int bit, unsigned short int* data)
{
	#ifndef NO_RANGE_CHECKING
		if (bit <= 15)
		{
			*data |= (1 << bit);
		}
	#else
		*data |= (1 << bit);
	#endif
	
	
}

